import { stringify } from 'qs';
import request from '@/utils/request';

import webpath from '@/utils/webpath';

export async function deleteByPrimaryKeyForProGroupAuth(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/delete?${stringify(params)}`);
}


export async function selectByPrimaryKeyForProGroupAuth(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/get?${stringify(params)}`);
}


export async function insertForProGroupAuth(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function updateForProGroupAuth(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function deleteByMapForProGroupAuth(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/deleteByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateByMapForProGroupAuth(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/updateByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function getOneForProGroupAuth(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/getOne`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}



export async function getAllForProGroupAuth(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function queryPageForProGroupAuth(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function countForProGroupAuth(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/count`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function insertBatchForProGroupAuth(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/insertBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function deleteBatchForProGroupAuth(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/deleteBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateBatchForProGroupAuth(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/updateBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}

export async function queryPageForProGroup(params = {}) {
    return request(`/${webpath}/web/api/service/progroup/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getPageProAuthorityByGroupId(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/getPageProAuthorityByGroupId`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function queryPageForProAuthChild(params = {}) {
    return request(`/${webpath}/web/api/service/proauthority/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getSelectedProAuthByGroupId(params = {}) {
    return request(`/${webpath}/web/api/service/progroupauth/getSelectedProAuthorityByGroupId`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}
